package org.cskj.demo.demo.service.imp;

import org.cskj.demo.mapper.ShopMapper;
import org.cskj.demo.pojo.Shop;
import org.cskj.demo.service.ShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class ShopImp implements ShopService {
    @Autowired
    private ShopMapper shopMapper;
    @Override
    public List<Shop> seletcLimit(int page, int pagesize) {
        Map map=new HashMap();
        map.put("start",(page-1)*pagesize);
        map.put("end",pagesize);
        System.out.println(map);
        List<Shop> shops = shopMapper.selectq(map);
        for (Shop shop : shops) {
            System.out.println(shop);
        }
        return shops;
    }
    public int count(){
        int i = shopMapper.countByExample(null);
        return i;
    }
}
